//
//  SSDKPluginDataHelper.m
//  SuperSDK
//
//  Created by wyht－ios－dev on 15/10/7.
//  Copyright © 2015年 WYHT. All rights reserved.
//

#import "SSDKPluginDataHelper.h"

@implementation SSDKPluginDataHelper

static SSDKPluginDataHelper *instance = nil;

+ (id)instance {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [[self alloc] init];
        instance.data = [[NSMutableDictionary alloc] init];
    });
    return instance;
}

+ (void)setDataValue:(NSObject *)value
              forKey:(NSString *)key {
    if (!instance) {
        [self instance];
    }
    
    [instance.data setValue:value forKey:key];
}

+ (NSObject *)dataValueWithKey:(NSString *)key {
    if (!instance) {
        [self instance];
    }
    
    return [instance.data valueForKey:key];
}

+ (void) removeDataByKey : (NSString *) key {
    if (!instance) {
        [self instance];
    }
    [instance.data removeObjectForKey:key];
}

@end
